package Demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-19
 * Time: 21:22
 */

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int a = reader.nextInt();
        int b = reader.nextInt();

        System.out.println(gcd(a, b));
        System.out.println(lcm(a, b));
        reader.close();
    }

    public static int gcd(int m, int n) //求最大公约数
    {
        while (n != 0) {
            int c = m % n;
            m = n;
            n = c;
        }
        return m;
    }

    public static int lcm(int m, int n) //求最小公倍数
    {
        return m*n/gcd(m,n);
    }
    /* 请在这里填写答案 */

}